<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@page import="com.base.model.ServiceInfo"%>
    <%@page import="java.util.*"%>
    <%if(session.getAttribute("userName")==null){ 
    	response.sendRedirect(request.getContextPath()+"/pages/admin/login.jsp");
    }
    List<ServiceInfo> results = (List<ServiceInfo>)request.getAttribute("list");
    %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>服务信息页</title>
	<link href="<%=request.getContextPath() %>/css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<style type="text/css"> 
<!--
body,td,th {
	font-size: 9pt;
}
.border-l-b-r-t {
	BORDER-RIGHT: #cecfce 1px solid; BORDER-TOP: #cecfce 1px solid; BORDER-LEFT: #cecfce 1px solid; BORDER-BOTTOM: #cecfce 1px solid
}
.main_table{
      font-size:12px;
}
.main_table input{
   border:1px FF9900 solid;
   background:#f9b88a;
 
 
}
 
.main_table textarea{
   border:1px FF9900 solid;
   background:#f9b88a;
}
-->
</style>
 
<!-- 添加留言 -->
<script language="javascript"> 
	function load(id){
		document.form1.action = "ServiceServlet.do?method=load&serviceId="+id;
		document.form1.submit();
	}
	function insert(){
		document.form1.action = "ServiceServlet.do?method=forInsert";
		document.form1.submit();
	}
	function update(id){
		document.form1.action = "ServiceServlet.do?method=forUpdate&serviceId="+id;
		document.form1.submit();
	}
	function deleteInfo(id){
		document.form1.action = "ServiceServlet.do?method=delete&serviceId="+id;
		document.form1.submit();
	}
</script>

<FORM name="form1" method="post">
	<div style="float:left;margin-top:10px;height:250px;overflow: auto;" >
	<input type="button" value="新增" onclick="insert();" />
			<table border="1" cellpadding="0" cellspacing="0" class="Listing"  style="float:left;">
				<tr><th>服务名称</th>
						<th>描述</th>
						<th>操作</th></tr>
				<%
					if(results != null && results.size()>0){
						for(int i = 0; i < results.size(); i++){
							ServiceInfo info = (ServiceInfo)results.get(i);
							%>
							<tr>
							<td><a id="<%=info.getServiceId() %>" href="javascript:load('<%=info.getServiceId() %>');"><%=info.getServiceSubject() %></a></td>
							<td><%=info.getServiceContent() %></td>
						 	<td nowrap="nowrap" align="center">
						 		<input type="button" value="修改" onclick="update('<%=info.getServiceId() %>');" />
						 		<input type="button" value="删除" onclick="deleteInfo('<%=info.getServiceId() %>');" />
						 	</td></tr>
							<%
						}
					}
				%>
			</table>
	</div>
  </FORM>

</body>
</html>